#!/bin/bash
# 
# File: move-tunnel-sites.sh
# Purpose: move tunnel sites file
#

cd $(dirname "$0")
. ./common.sh

INSTALLDIR=$(cd "$(dirname "$0")"; pwd);
src_dir=$INSTALLDIR/$config_tmp_dir
dist_dir=$INSTALLDIR/$config_dir

test "$1" && tunnelsites="$@" || tunnelsites=$(./sites-tmp.sh)

for tunnelsite in $tunnelsites; do
	if [ $tunnelsite ]; then
		tunnel_name=`echo ${tunnelsite} | cut -d = -f 1`;
		src_file=$src_dir/$tunnel_name;
		echo $tunnel_port
		if test -f $src_file; then
			mv $src_file $dist_dir
		else
			warn '['$src_file'] not exist';
		fi
	fi
done
	





